<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>${applicationScope.textCheckExecute} (${param.taskID})</title>

    <style type="text/css">
    .yui3-insheet-formfield-header {padding-left:2px;text-align: left;}
    .yui3-insheet-formfield-content {overflow: hidden;}/*vertical-align: middle;*/
	.yui3-insheet-formfield-content .ff-text { display:inline-block; height:16px;width:20px;border:1px solid #ccc;background-color:white;padding-top:2px;padding-left:2px;}
	.yui3-insheet-formfield-content .ff-textarea { border:1px solid #ccc;background-color:white;padding-top:2px;padding-left:2px;}
	.yui3-insheet-formfield-content select { border:1px solid #ccc;background-color:white}
	
	.yui3-insheet-form-table { padding: 0; margin: 0; line-height: 16px; background-color: #F7FBFA;}
	.yui3-insheet-form-table-td { margin:0; padding:1px;}
    </style>
</head>
<%--检查执行情况表 东城公共安全项目--%>
<body class="yui3-container yui3-dlg-container yui3-register">
<div id="contentPane" style="position:absolute;width:100%;height:100%; text-align: left;">
    <div class="yui3-widget yui3-component yui3-pane">
        <div class="yui3-pane-content" style="z-index: 0;">
<!--             <div class="yui3-pane-bg-container" style="z-index: -1;">
                <div class="yui3-pane-bg yui3-pane-bg-c"></div>
                <div class="yui3-pane-bg yui3-pane-bg-t"></div>
                <div class="yui3-pane-bg yui3-pane-bg-rt"></div>
                <div class="yui3-pane-bg yui3-pane-bg-r"></div>
                <div class="yui3-pane-bg yui3-pane-bg-rb"></div>
                <div class="yui3-pane-bg yui3-pane-bg-b"></div>
                <div class="yui3-pane-bg yui3-pane-bg-lb"></div>
                <div class="yui3-pane-bg yui3-pane-bg-l"></div>
                <div class="yui3-pane-bg yui3-pane-bg-lt"></div>
            </div>--> 
            <div class="yui3-pane-caption">
                <div class="yui3-pane-caption-title">
                    ${applicationScope.textCheckExecute}
                    <span id="reg_taskNum">
                        (${param.taskNum})
                    </span>
                </div>
            </div>
            <!-- 任务名称： -->
            <div class="yui3-pane-container yui3-register-content" style="display:none">
                <table cellpadding="0" class="yui3-insheet-form-table" style="width: 100%;">
                    <!-- 检查情况 -->
                    <tr class="yui3-insheet-form-table-tr-top yui3-insheet-form-table-tr-odd">
                        <td class="yui3-insheet-form-table-td" rowspan="1" >
                                    <table style="width: 100%;" >
                                    <tbody style="width: 100%;">
                                    <tr style="width: 100%;">
                                        <td class="yui3-insheet-formfield-content" style="width: 100%;">
                                        <table style="width: 100%;" class="yui3-register-table">
                                            <tr class="yui3-register-table-header-tr" style="width: 100%;text-align: center;">
                                                	<td style="width: 13%;" class="yui3-register-table-header">${applicationScope.textTDSpecialCheckItem}</td>
                                            		<td style="width: 49%;" class="yui3-register-table-header">${applicationScope.textTDCheckContent}</td>
                                            		<td style="width: 8%;" class="yui3-register-table-header">${applicationScope.textTDSceneCheckInfo}</td>
                                            		<td style="width: 10%;" class="yui3-register-table-header">${applicationScope.textTDPicture}</td>
                                            		<td style="width: 20%;" class="yui3-register-table-header">${applicationScope.textTDMemo}</td>
                                            		<input type="hidden" id="checkItemListSum" value="${checkItemListSum}"/>
                                            </tr>
                                        </table><%--动态合并单元网格代码块 --%>
                                            <table style="width: 100%;" class="yui3-register-table">
                                            <c:set var="tempCount" value="0"></c:set><%--临时变量 --%>
                                            <c:set var="rowspanCount" value="0"></c:set><%--记录合并列数 --%>
                                            <c:set var="tempFrist" value="0"></c:set><%--记录合并开始位置 --%>
                                            <c:set var="tempEnd" value="-1"></c:set><%--记录合并结束位置 --%>
                                            	<c:forEach var="item" items="${checkItemList}" varStatus="status">
                                            		<tr style="width: 100%;" class="yui3-register-table-content-tr">
                                            		<%--第二种方法，单纯利用一个结果集List<Bean>来生成，数据过多会加重客户断负担 --%>
                                            		<c:if test="${status.index>=tempEnd}">
                                            			<c:set var="rowspanCount" value="0"></c:set><%--清楚历史数据 --%>
	                                            		<c:forEach var="item2" items="${checkItemList}" varStatus="status2">
	                                            			<c:if test="${item.specialCheckItem==item2.specialCheckItem}">
	                                            				<c:set var="tempFrist" value="${status.index }"></c:set>
	                                            				<c:set var="rowspanCount" value="${rowspanCount+1 }"></c:set>
	                                            				<c:set var="tempEnd" value="${tempFrist+rowspanCount }"></c:set>
	                                            			</c:if>
	                                            		</c:forEach>
                                            		</c:if>
                                            		
                                            		
                                            			<%--第一种方法，需要后台提供分组相同排序数据，并放在List<Bean>中 --%>
	                                            		<%-- <c:if test="${status.index>=tempEnd}">
	                                            				<c:set var="tempFrist" value="${status.index }"></c:set>
	                                            				<c:set var="rowspanCount" value="${checkItemGroupList[tempCount].id }"></c:set>
	                                            				<c:set var="tempCount" value="${tempCount+1 }"></c:set>
	                                            				<c:set var="tempEnd" value="${tempFrist+rowspanCount }"></c:set>
		                                            	</c:if> --%>
		                                            	
	                                            		<c:if test="${status.index==tempFrist}">
	                                            			<td style="text-align: left;width: 13%;" class="yui3-register-table-content" rowspan="${rowspanCount}">
			                                            		${item.specialCheckItem}
			                                            	</td>
	                                            		</c:if>
	                                            		
	                                            		<td style="text-align: left;width: 49%;" class="yui3-register-table-content">
	                                            		<input type="hidden" id="checkItemID_${status.index}" value="${item.checkItemID}"/>
	                                            		${item.itemName}
	                                            		</td>
	                                            		
	                                            		<td style="text-align: center;width: 8%;" class="yui3-register-table-content">
	                                            		<select id="checkResultName_${status.index}"  style="width: 100%;height: 25px;">
			                                                <option value=""></option>
			                                                <c:forEach var="item" items="${commonList}">
			                                                	<c:if test="${item.dicType=='CheckItemContent'}">
			                                                		<c:if test="${param.checkType==item.dicCode}">
			                                                            <option value="${item.dicCode}" selected>${item.dicName}</option>    
			                                                        </c:if>
			                                                        <c:if test="${param.checkType!=item.dicCode}">
			                                                            <option value="${item.dicCode}">${item.dicName}</option>
			                                                        </c:if>  
			                                                	</c:if>
			                                                </c:forEach>
			                                            </select>
	                                            		
	                                            		</td>
	                                            		
	                                            		<td style="text-align: center;width: 10%;" class="yui3-register-table-content">上传图片</td>
	                                            		
	                                            		<td style="text-align: left;width: 20%;" class="yui3-register-table-content">
	                                            		<textarea id="memo_${status.index}"  class="yui3-register-table-content" style="height: 99%; width: 99%;"></textarea>
	                                            		</td>
                                            		</tr>
                                            	</c:forEach>
                                            </table>
                                        </td>
                                    </tr>
                                    </tbody>
                                    </table>
                        </td>
                    </tr>
                    <tr class="yui3-insheet-form-table-tr-top yui3-insheet-form-table-tr-odd" id="trRemark">
                        <td class="yui3-insheet-form-table-td" rowspan="1" >
                            <div  class="yui3-widget yui3-formfield yui3-textareafield">
                                <div class="yui3-register-form-field-container yui3-textareafield-content" style="width: 100%;" >
                                    <table style="width: 100%;">
                                    <tbody style="width: 100%;">
                                    <tr style="width: 100%;">
                                        <td class=" yui3-insheet-formfield-header " valign="middle" style="width: 13%; overflow: hidden;">
                                            ${applicationScope.textRemark}
                                        </td>
                                        <td class=" yui3-insheet-formfield-content " style="width: 87%;">
                                            <textarea  id="insheet_Remark" class="ff-textarea" style="height: 38px; width: 99.5%;">${rec.checkResult}</textarea>
                                        </td>
                                    </tr>
                                    </tbody>
                                    </table>
                                </div>
                            </div>
                        </td>
                    </tr>
                                    </tbody>
                                    </table>
                                </div>
                            </div>
            </div>
        </div>
<!-- 按钮行 -->
<div id="regButtonBar" class="yui3-box-controller wbtn-flat" style="display: block;width:100%;text-align: center;">
    <div id="insheet_transitBtn" title="${applicationScope.textRegBtnTransit}" class="yui3-box-wbtn yui3-box-wbtn-transit">
        <a class="inner">
            <span class="icon small-icon-transit"></span>
            <span class="text">${applicationScope.textRegBtnTransit}</span>
        </a>
    </div>  
    <div id="insheet_cancelBtn" title="${applicationScope.textRegBtnCancelReg}" class="yui3-box-wbtn yui3-box-wbtn-close">
        <a class="inner">
            <span class="icon small-icon-close"></span>
            <span class="text">${applicationScope.textRegBtnCancelReg}</span>
        </a>
    </div>
    <div id="insheet_saveBtn" title="${applicationScope.textRegBtnSaveRec}" class="yui3-box-wbtn yui3-box-wbtn-save">
        <a class="inner">
            <span class="icon small-icon-save"></span>
            <span class="text">${applicationScope.textRegBtnSaveRec}</span><!--存盘 -->
        </a>
    </div>
</div>

<div id="hiddenXXX" style="display:none">
    <c:if test="${disableVerifyBtn==1}">
    <div id="insheet_vertifyBtn" title="${applicationScope.textRegBtnVerify}" class="yui3-box-wbtn yui3-box-wbtn-chk">
        <a class="inner">
            <span class="icon small-icon-send"></span>
            <span class="text">${applicationScope.textRegBtnVerify}</span>
        </a>
    </div>
    </c:if>

</div>
<script type="text/javascript">

    var recTypeInformationID = "${recTypeInformationID}";
    var trueMap = "${trueMap}"==="true";
    var trueMapIsOpen = "${trueMapIsOpen}"==="true";
    var multiLevel = "${multiLevel}"==="true";
    var timeAreaAutoCheck = "${timeAreaAutoCheck}"==="true";
    var disableVerifyBtn = "${disableVerifyBtn}"==="1";
	var projGuID = "${param.projGuID}" === "" ? 1 : "${param.projGuID}";

    YUI().use("node", "event", function(Y){
        var resizeHandler = function() {
            var height = Y.one("body").get("winHeight"),
                width = Y.one("body").get("winWidth"),
                contentPane = Y.one("#contentPane"),
                map = Y.one("#map");
            contentPane.setStyle("height", height-55);
            contentPane.one(".yui3-pane-container").setStyle(
                    "height", contentPane.get("offsetHeight")).setStyle("display", "");
        }
        Y.on("domready", resizeHandler);
        Y.on("windowresize", resizeHandler, this);
    });

    var taskListID = ${param.taskListID} || "";
    var taskID="${param.taskID}";
    var action = "${param.action}";
    var i18n = {
            "recRegTitle": "${applicationScope.textRegDlgTitle}",
			"savesucess": "${applicationScope.textCommonDataSaved}",
		}
</script>
<script type="text/javascript" src="<c:url value='/view/operation/insheet/companycheckinsheet.js'/>"></script>
</body>
</html>